import 'dart:async';

import 'package:flutter/services.dart';

class BraintreePayments {
  static const MethodChannel _channel =
      const MethodChannel('braintree_payments');

  static Future<String> pay({String token, String amount, String currency }) async {
    try {
      final String nonce = await _channel.invokeMethod('pay', {
        "token": token,
        "amount": amount,
        "currency": currency,
      });
      return nonce;
    } catch (e) {
      return null;
    }
  }
}
